<!-- topbar starts -->
<header id="header" class="navbar navbar-default" role="navigation">
			<!-- 
			<div id="logo-group">
				<span id="logo"><a class="navbar-brand" style="padding:10px 40px;" href="{{Router::url('/')}}">Miao CMS</a></span>
			</div>
			 -->
			<div class="navbar-header pull-left hidden-sm hidden-xs">
					<a class="navbar-brand" href="#">
							<i class="fa fa-leaf"></i>&nbsp;MiaoCMS
					</a><!-- /.brand -->
			</div>
			<!-- projects dropdown -->
			<!-- pulled right: nav area -->
			<div class="pull-right mr20">
				
				<ul class="nav navbar-nav navbar-right  hidden-sm hidden-xs">
					<li>
				  		<a href="{{$this->Html->image('/',array('onlyurl'=>true))}}" target="_blank"><i class="glyphicon glyphicon-new-window"></i> {{__('Visit website')}}</a>
				  	</li>
				  	<li>				
					<a class="dropdown-toggle" data-toggle="dropdown" href="#">
						<span class="fa fa-user"></span>&nbsp;{{$this->Session->read('Auth.Staff.name')}}
						<i class="fa fa-angle-down"></i>
					</a>
					<ul class="dropdown-menu" style="margin-left:-70px;">
						<li><a href="#">{{__('Profile')}}</a></li>
						<li class="divider"></li>
						<li>{{$this->Html->link(__('Default Mode'), '/?theme=default')}}</li>
						<li>{{$this->Html->link(__('Desktop Mode'), '/?theme=desktop')}}</li>
						<li>{{$this->Html->link(__("File Manage"), '/admin/ace/editors/index')}}</li>
						<li class="divider"></li>
						  {{loop $selectlans $lan $native}}        	 
				          <li>
				          		<a href="{{$this->Html->image('/'.$lan.'/admin/',array('onlyurl'=>true))}}">{{$native}}</a> 
				          </li>
				          {{/loop}}
						<li class="divider"></li>
						<li><a href="{{Router::url('/admin/staffs/logout')}}">{{__('Logout')}}</a></li>
					</ul>
					</li>
				</ul>
				<!-- input: search field
				<form class="header-search pull-right mt10 form-inline hidden-sm hidden-xs" action="#ajax/search.html">
					<input type="text" id="search-fld" class="form-control" placeholder="search" name="param">
					<button type="submit" class="btn btn-default">
						<i class="fa fa-search"></i>
					</button>
					<a title="Cancel Search" id="cancel-search-js" href="javascript:void(0);"><i class="fa fa-times"></i></a>
				</form>
				 -->
			</div>
			<!-- end pulled right: nav area -->
			
			<div style="display:block;float:none;margin-left:256px">
				
				<?php if(!isset($menuid)) $menuid=1; ?>
				{{$this->Section->getNavMenu('Menu',array(
					'selectedid'=> $top_category_id,
					'preli'=>'', 'ulAttributes'=>array('id'=>'top-navbar','class'=>'nav navbar-nav'),
					'maxdepth' => 1,
					'sufli'=>'',
				),$menuid,false)}}
			</div>

			

</header>

<script>
	$(function(){
		/*切换菜单*/
		$("#top-navbar a").on('click',function(e){
			var ref = $(this).attr('ref');
			$('#top-navbar').find('.active').removeClass('active');
			$(this).blur().parent('li:first').addClass('active');
			$('#leftmenucontent').find('.leftmenu').hide();
			$('#leftmenucontent').find('#leftmenu_'+ref).show();
			e.preventDefault();
			return false;
		});
	})	
</script>